username = 'xupf'
password = '123'
count = 3
while count:
    user = input('username: ')
    password = input('password: ')
    if user == username and password == password:
        print('Login Successful')
        count = 0
        continue
    else:
        print('Wrong user name or password!!!')
        count -=1
        if count == 0:
            print('Password error 3 times, exit!!!')

# 这里用for的话会不会更好些呢

#for 循环
username = 'xupf'
password = '123'
count = 3
for i in range(count+1):
    user = input('username: ')
    password = input('password: ')
    if user == username and password == password:
        print('Login Successful')
        break
    else:
        print('Wrong user name or password!!!')
        count -= 1
        if count == 0:
            print('Password error 3 times, exit!!!')
            break
